package com.joven.shelltest.listener;

import com.joven.shelltest.model.JovenEvent;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @Author wzj
 * @Date 2023-08-10 14:58
 **/
@Component
public class JovenListener {
    @Async
    @EventListener
    public void listenerEvent(JovenEvent myEvent){
        System.out.println("已经监听到事件发生了");
        // 调用发邮件方法
        System.out.println(myEvent.getMail());
    }
}
